<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="s" uri="/struts-tags"%>

  <head>
    <base href="<%=basePath%>">
    <title>修改密码问题</title>
    <script type='text/javascript' src='dwr/interface/userdwr.js'></script>
    <script type="text/javascript" src="<s:url value="/js/jquery-1.4.2.min.js"/>"></script>
 <script type='text/javascript' src='js/jquery.validate.min.js'></script>
 <script type='text/javascript' src='js/common.js'></script>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<link href="images/css.css"  rel="stylesheet" type="text/css" />
	<style type="text/css">
<!--
a:link {
	text-decoration: none;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
.STYLE13 {color: #A3A3A3}
.STYLE15 {color: #F18910}


-->
</style>
<script type="text/javascript">
  function checkValid(){
  	  var pwdQuestion = $.trim($("#pwd_question").val());  //密码问题
  	  var answer = $.trim($("#pwd_answer").val());   //密码问题答案

	  var dbQuestion = $.trim($("#dbPwdQuestion").val());
//	  alert("dbQuestion="+dbQuestion);
	 
	    if(answer==""){ //效验查询答
			$("#answerSpan").html("");
			$("#answerSpan").html("请输入问题答案.");
			$("#pwd_answer").focus();
			return false;
		}else{
			if(isIllegalChar(answer)){
				$("#answerSpan").html("&nbsp;输入的问题答案包含了非法字符.");
				$("#pwd_answer").select();
				return false;
			}else{
				$("#answerSpan").html("");
			}
		}
				
	  return true;
  }
  //表单提交
  function modifyQuestionSubmit()
  {
  		if(!checkValid()){
  			return false;
  		}else{
  			document.modQuestion.submit();
  		}
  }
  
function isZiMu_Num(str) {
	//var voidChar = /[@#\$%\^&\*]+/g;
	var voidChar = /^[A-Za-z0-9_]+$/g;
	
	return voidChar.test(str);
}
/**
 * 验证输入的字符是否包含@#$%^&*:|+)(!~=}{;?>`<'非法字符
 * 如果返回true为包含,false不包含非法字符
 */	
function isIllegalChar(str) {
	var voidChar = /[@#\$%\^&\*\+\?:|.!~=>`<]+/g;
	return voidChar.test(str);
}
  
</script>

</head>
  
<body>
  <form action="userRegister!doMoidyPwdQuestionAndAnswer.action" name="modQuestion" method="post">
	<table width="789" height="539" border="0" cellpadding="0" cellspacing="0" bgcolor="#F1F1F1">
  <tr>
    <td width="789" height="39" align="left" valign="middle">
    <span class="STYLE1">&nbsp;<a href="javascript:void(parent.window.location.href='loginAction!login.action')" class="STYLE1">我的易彩通</a> &gt; 我的帐户 &gt; 密码查询问题</span>
    </td>
  </tr>
  <tr>
    <td height="500" align="left" valign="top" bgcolor="#FFFFFF" style="border:1px solid #C5C5C5; padding:1px ;">
    <table width="100%" height="32" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="1%" height="32" background="images/sp_bg.jpg">&nbsp;</td>
        <td width="8%" align="center" background="images/sp_bg.jpg" style="border-bottom:1px solid #C5C5C5;">
            <img src="images/dian.jpg" width="10" height="16" />&nbsp;&nbsp;<a href="userRegister!toEnterModUserPwd.action" ><u>修改密码</u></a></td>
        <td width="55%" align="left" background="images/sp_bg.jpg" style="border-bottom:1px solid #C5C5C5;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        	<img src="images/dian.jpg" width="10" height="16" />&nbsp;&nbsp;密码查询问题</td>
        
        <td width="1%" background="images/sp_bg.jpg">&nbsp;</td>
      </tr>
    </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> <%-- 20120131 操作成功提示信息 --%>
          <td height="48" align="center"><span style="color:blue;"><s:property value="ActionError"/></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        </tr>
      </table>

      <input type="hidden" name="dbPwdQuestion" id="dbPwdQuestion" value='<s:property value="#session.userObject.pwdQuestion" />' />
      <table width="610" height="150" border="0" cellpadding="0" cellspacing="0">
        <tr>
        <input type="hidden" name="user.account"  id="userMobile" value="<s:property value="#session.userObject.account" />"/>
          <td width="151" align="right">密码查询问题：</td>
          <td width="459" align="left">
          <s:select list="#{'我手机号码的后6位?':'我手机号码的后6位?',
                  '我母亲的生日?':'我母亲的生日?',
                  '我父亲的生日?':'我父亲的生日?',
                  '我最好朋友的生日?':'我最好朋友的生日?',
                  '我儿时居住地的地址?':'我儿时居住地的地址?',
                  '我小学校名全称?':'我小学校名全称?',
                  '离我家最近的医院全称?':'离我家最近的医院全称?',
                  '离我家最近的公园全称?':'离我家最近的公园全称?',
                  '我的座右铭是?':'我的座右铭是?',
                  '我最喜爱的电影?':'我最喜爱的电影?',
                  '我最喜爱的歌曲?':'我最喜爱的歌曲?',
                  '我最喜爱的食物?':'我最喜爱的食物?',
                  '我最大的爱好?':'我最大的爱好?',
                  '我最喜欢的小说?':'我最喜欢的小说?',
                  '我最喜欢的运动队?':'我最喜欢的运动队?'}" id="pwd_question" name="user.pwdQuestion" value=""  listValue="value" listKey="key" style="width:150px;">
           </s:select>
          
          &nbsp;<font color="red">*&nbsp;<span style="color:red" id="questionSpan"></span></font>
          </td>
        </tr>
        <tr>
          <td align="right">密码查询答案：</td>
          <td align="left">
          <input name="user.pwdAnswer" id="pwd_answer" type="text" size="20" value="<s:property value="#session.userObject.pwdAnswer" />" style="border:1px solid #DBDBDB; height:20px;"  />
            &nbsp;<font color="red">*</font>&nbsp;<span style="color:red" id="answerSpan"></span>
          </td>
        </tr>
       
        <tr>
          <td height="51">&nbsp;</td>
          <td align="left">
          <img src="images/bc.jpg" onclick="javascript:modifyQuestionSubmit();" style="cursor:hand" width="92" height="24" />
          </td>
        </tr>
      </table>
      </td>
  </tr>
</table>    

</form>
  </body>
  
<script type="text/javascript">
loadQuestion();
function loadQuestion(){ //加载下拉框的初始值
  var questionVal = $.trim($("#dbPwdQuestion").val());
  var pwdQues = document.getElementById("pwd_question");
//var pwdQues = document.getElementsByName("user.pwdQuestion");
  //alert("questionVal= "+questionVal);
/*  for(i=0;i < pwdQues.options.length;i++) {
   // alert("问题："+pwdQues.options[i].value);
 	 if(pwdQues.options[i].value == questionVal){
  	 	pwdQues.options[i].selected = true;
  	 	break;
  	 }
  }*/
  if(questionVal != "" && questionVal != null){
  	 pwdQues.value = questionVal; //设置初始值
  }
  
}

</script>

</html>
